/*
** vputa.c
**
** Pictor, Version 1.51, Copyright (c) 1992-94 SoftCircuits
** Redistributed by permission.
*/

#include "pictor.h"

/*
** Prints attribute-only to current video position.
*/
void vputa(int attribute)
{
	/* Got lazy, so I put only the outside __asm{} loop for now- W. Jones. */
	_asm{
	_asm	mov	di,_PL_offset
	_asm	inc	di
	_asm	mov	ax,_PL_segment
	_asm	mov	es,ax
	_asm	mov	ax,attribute
	_asm	cmp	_PL_snowcheck,FALSE
	_asm	je 	direct
	_asm	mov	bx,ax
	_asm	mov	dx,CGA_STATUS_PORT
	scan_lo:
	_asm	in 	al,dx
	_asm	shr	al,1
	_asm	jc 	scan_lo
	_asm	cli
	scan_hi:
	_asm	in 	al,dx
	_asm	shr	al,1
	_asm	jnc	scan_hi
	_asm	xchg	ax,bx
	_asm	stosb
	_asm	sti
	_asm	jmp   end_vputa
	direct:
	_asm	stosb
	end_vputa:
	_asm	mov   _PL_offset,di
	};

} /* vputa */
